package com.sdyeda.readiot.data;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SetSaveServiceImpl implements SetSaveService {

	@Autowired
	private SetSaveRepositopy saveRepository;

	@Override
	public List<com.sdyeda.readiot.data.SetSave> findAll() {
		return saveRepository.findAll();
	}

	@Override
	public SetSave findById(Integer id) {
		Optional<SetSave> save = saveRepository.findById(id);
		return (save != null) ? save.get() : null;
	}

	@Override
	public void save(SetSave save) {
		saveRepository.save(save);
	}

	@Override
	public void delete(SetSave save) {
		saveRepository.delete(save);
	}

}
